Conditions | 1 |
Paths | 2 |
Total Lines | 30 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | jQuery(document).ready(function ($) { |
||
4 | .click(function (event) { |
||
5 | event.preventDefault(); |
||
6 | |||
7 | var spinner = $(this).find('a'); |
||
8 | pagespeed_purge_animate(spinner); |
||
9 | |||
10 | // Purge cache for the entire website |
||
11 | // More info: https://modpagespeed.com/doc/system#purge_cache |
||
12 | $.ajax({ |
||
13 | method: "PURGE", |
||
14 | url: document.location.origin + '/*' |
||
15 | }) |
||
16 | .done(function (msg) { |
||
17 | if (msg && msg.indexOf("successful") > -1) { |
||
18 | pagespeed_purge_success(spinner); |
||
19 | } else { |
||
20 | pagespeed_purge_error(spinner); |
||
21 | } |
||
22 | }) |
||
23 | .fail(function () { |
||
24 | pagespeed_purge_error(spinner); |
||
25 | }) |
||
26 | .always(function () { |
||
27 | setTimeout(function () { |
||
28 | pagespeed_purge_reset(spinner); |
||
29 | }, 750); |
||
30 | }); |
||
31 | |||
32 | return false; |
||
33 | }); |
||
34 | |||
54 | }); |